﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAO;
using DTO;

namespace BUS
{
    public class TuyenBay_BUS
    {
        public static List<TuyenBay_DTO> GetTuyenBayList()
        {
            List<TuyenBay_DTO> listtuyenbay = new List<TuyenBay_DTO>();
            try
            {
                TuyenBay_DAO tuyenbayDAO = new TuyenBay_DAO();
                listtuyenbay = tuyenbayDAO.GetTuyenBayList();
            }
            catch (System.Exception)
            {

            }
            return listtuyenbay;
        }
        public static TuyenBay_DTO GetTuyenBayDetails(string mMaTuyenBay)
        {
            TuyenBay_DTO tuyenbayDTO = new TuyenBay_DTO();
            try 
            {
                TuyenBay_DAO tuyenbayDAO = new TuyenBay_DAO();
                tuyenbayDTO = tuyenbayDAO.GetTuyenBayDetails(mMaTuyenBay);
            }
            catch(System.Exception)
            {}
            return tuyenbayDTO;
        }
        public static string MaxMaTuyenBay()
        {
            return TuyenBay_DAO.MaTuyenBayMax();
        }

        public static void InsertTuyenBay(TuyenBay_DTO tuyenbayDTO)
        {
            try
            {
                TuyenBay_DAO tuyenbayDAO = new TuyenBay_DAO();
                tuyenbayDAO.InsertTuyenBay(tuyenbayDTO);
            }
            catch
            { }
        }

        public static void UpdateTuyenBay(TuyenBay_DTO tuyenbayDTO)
        {
            try
            {
                TuyenBay_DAO tuyenbayDAO = new TuyenBay_DAO();
                tuyenbayDAO.UpdateTuyenBay(tuyenbayDTO);
            }
            catch
            { }
        }

        public static void DeleteTuyenBay(TuyenBay_DTO tuyenbayDTO)
        {
            try
            {
                TuyenBay_DAO tuyenbayDAO = new TuyenBay_DAO();
                tuyenbayDAO.DeleteTuyenBay(tuyenbayDTO);
            }
            catch
            { }
        }
    }
}
